package com.demo.touca;

import com.demo.touca.domain.Student;

import java.util.List;
import java.util.NoSuchElementException;

public class Students {

    public static List<Student> students;

    public static Student findStudent(final String username) {
        for (Student student : Students.students) {
            if (student.username.equals(username)) {
                return new Student(student.username, student.fullName, student.dob, student.gpa);
            }
        }
        throw new NoSuchElementException(
                String.format("No student found for username: %s", username));
    }
}
